Page({
  data: {
    moves: [],
    title: "888",
    searchValue: '',
    imgUrls: ['http://n.sinaimg.cn/sinacn/w1920h1200/20180124/9a5b-fyqwiqk3442872.jpg', 'http://i.shangc.net/2017/0805/20170805051243531.jpg',
      'http://pic1.win4000.com/wallpaper/f/58cf42655066a.jpg'
    ],
    interval: 5000,
    duration: 1000,
    movielist: []
  },
  changeIndicatorDots: function(e) {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },
  onLoad: function(options) {
    // 页面初始化 options为页面跳转所带来的参数
    var that = this;
    wx.request({
      url: '',
      success: function(res) {
        console.log(res);
        that.setData({
          movielist: res.data
        })
      }
    });
    wx.getSystemInfo({
      success: function(res) {
        var height = res.windowHeight;
        that.setData({
          scrollTop: height - 185
        })
      }
    });
  },
  onReady: function() {
    // 页面渲染完成
  },
  gotoDetail: function(event) {
    var id = event.currentTarget.dataset.vid;
    console.log(event, id);
    wx.navigateTo({
      url: '/pages/videoDetail/videoDetail?id=' + id
    });
  },

  //得到搜索框的内容并渲染到data下的searchValue中
  searchValueInput: function(e) {
    var value = e.detail.value;

    this.setData({
      searchValue: value,
    })

  },
  //按钮点击事件
  
  btn_search: function() {
    // 加载当前热映电影目录
    wx.showToast({
      title: '正在加载',
      icon: 'loading',
      duration: 5000

    })
    let thisPage = this;
    if (thisPage.data.searchValue!=''){
      var i = thisPage.data.searchValue
        wx.navigateTo({
         
          url: '../videolist/videolist?serachval='+i,
          success: function(res) {

          }
         
        })

        
        

        
      
    }

    


  }





})